﻿/*
 *
 * The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * 
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * 
 * See the License for the specific language governing rights and limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace FBConnectAuth
{
	/// <summary>
	/// An object representing a Facebook Connect Session
	/// </summary>
	public sealed class FBConnectSession
	{

		/// <summary>
		/// Initializes a new instance of the <see cref="FBConnectSession"/> class.
		/// </summary>
		internal FBConnectSession(int expires, string sessionKey, string sessionSecret, string userId, string accessToken)
		{
			Expires = expires;
			SessionKey = sessionKey;
			SessionSecret = sessionSecret;
			UserID = userId;
			AccessToken = accessToken;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="FBConnectSession"/> class.
		/// </summary>
		internal FBConnectSession(int expires, string sessionKey, string sessionSecret, string userId)
			: this(expires,sessionKey,sessionSecret,userId,null) {}

		/// <summary>
		/// The expiry time for the session
		/// </summary>
		public int Expires
		{
			get;
			private set;
		}
		
		/// <summary>
		/// The session key used by Facebook
		/// </summary>
		public string SessionKey
		{
			get;
			private set;
		}

		/// <summary>
		/// The session-specific secret for this session/application tuple. Not to be confused with the Application Secret.
		/// </summary>
		public string SessionSecret
		{
			get;
			private set;
		}

		/// <summary>
		/// The Facebook User ID of the user.
		/// </summary>
		public string UserID
		{
			get;
			private set;
		}

		/// <summary>
		/// The Facebook Facebook Graph API Access Token (available only when using the Graph API).
		/// </summary>
		public string AccessToken
		{
			get;
			private set;
		}
	}
}
